use "C:\replication_data_aleman_etal.dta" 

** AMCEs and Figure 1 (Table 1 in appendix)

regress chosen i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1 [pweight = _webal], cluster ( newid)
coefplot, drop(_cons) xtitle(Estimated AMCEs)  xline(0, lcolor(red) lwidth(vthin) lpattern(solid))

** By Ideology and Figure 2 (Table 1 in appendix)

regress chosen i.ideocat##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1 retirement1 immigration1 propertytaxes1) at ( ideocat= (1 2 3))

*related figure
regress chosen i.ideocat##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1) at ( ideocat = (1 2 3)) post
est store Protect_unborn_life
regress chosen i.ideocat##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(retirement1) at ( ideocat = (1 2 3)) post
est store Individual_inheritable_ret
regress chosen i.ideocat##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(immigration1) at ( ideocat = (1 2 3)) post
est store Expel_undocumented_imm
regress chosen i.ideocat##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(propertytaxes1) at ( ideocat = (1 2 3)) post
est store Property_tax_exe

coefplot Protect_unborn_life Individual_inheritable_ret Expel_undocumented_imm Property_tax_exe, xtitle(AMCEs) xline(0, lcolor(red) lwidth(vthin) lpattern(solid)) coeflabels(1._at = "Izquierda" 2._at = "Centro" 3._at = "Derecha") grid(between glpattern(solid) glwidth(0.1) glcolor(gray)) legend(ring(1) pos(6)) xsize(11) ysize(10) xlabel(-.3(.1).3)

** By how the respondent voted in the 2022 Plebiscite and Figure 3 (Table 2 in appendix)

regress chosen i.prevreferendum##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1 retirement1 immigration1 propertytaxes1) at ( prevreferendum = (1 2 3))


*related figure
regress chosen i.prevreferendum##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1) at ( prevreferendum = (1 2 3)) post
est store Protect_unborn_life
regress chosen i.prevreferendum##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(retirement1) at ( prevreferendum = (1 2 3)) post
est store Individual_inheritable_ret
regress chosen i.prevreferendum##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(immigration1) at ( prevreferendum = (1 2 3)) post
est store Expel_undocumented_imm
regress chosen i.prevreferendum##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(propertytaxes1) at ( prevreferendum = (1 2 3)) post
est store Property_tax_exe

coefplot Protect_unborn_life Individual_inheritable_ret Expel_undocumented_imm Property_tax_exe, xtitle(AMCEs) xline(0, lcolor(red) lwidth(vthin) lpattern(solid)) coeflabels(1._at = "Voted Approve" 2._at = "Voted Reject" 3._at = "Blank/Null/Didn't Vote") grid(between glpattern(solid) glwidth(0.1) glcolor(gray)) legend(ring(1) pos(6)) xsize(11) ysize(10) xlabel(-.3(.1).3)


***************************** by "ningun" interest in the constitutional process, binary *****************************


regress chosen i.nointerest##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1 retirement1 immigration1 propertytaxes1) at (nointerest= (0 1))



**************************** by "ninguna confianza" in the Constitutional Council, binary *****************************

regress chosen i.notrustincc##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1 retirement1 immigration1 propertytaxes1) at (notrustincc= (0 1))



**************************** by "ninguna" identification or sympathy with a party, binary ********************************

regress chosen i.nopartysympathy##(i.abortion1 i.retirement1 i.immigration1 i.propertytaxes1) [pweight = _webal], cluster ( newid)
margins, dydx(abortion1 retirement1 immigration1 propertytaxes1) at (nopartysympathy= (0 1))

